// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ZDirMsSql.pas' rev: 5.00

#ifndef ZDirMsSqlHPP
#define ZDirMsSqlHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Windows.hpp>	// Pascal unit
#include <ZSqlExtra.hpp>	// Pascal unit
#include <ZSqlTypes.hpp>	// Pascal unit
#include <ZTransact.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <ZLibMsSql.hpp>	// Pascal unit
#include <ZDirSql.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Zdirmssql
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TDirMsSqlConnect;
class PASCALIMPLEMENTATION TDirMsSqlConnect : public Zdirsql::TDirConnect 
{
	typedef Zdirsql::TDirConnect inherited;
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg();
	
public:
	__fastcall TDirMsSqlConnect(void);
	__fastcall virtual ~TDirMsSqlConnect(void);
	virtual void __fastcall Connect(void);
	virtual void __fastcall Disconnect(void);
	virtual void __fastcall CreateDatabase(AnsiString Params);
	virtual void __fastcall DropDatabase(void);
};


class DELPHICLASS TDirMsSqlTransact;
class PASCALIMPLEMENTATION TDirMsSqlTransact : public Zdirsql::TDirTransact 
{
	typedef Zdirsql::TDirTransact inherited;
	
private:
	void *FHandle;
	void *FLoginRec;
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg();
	
public:
	__fastcall TDirMsSqlTransact(TDirMsSqlConnect* AConnect);
	__fastcall virtual ~TDirMsSqlTransact(void);
	virtual void __fastcall Open(void);
	virtual void __fastcall Close(void);
	virtual void __fastcall StartTransaction(void);
	virtual void __fastcall EndTransaction(void);
	virtual void __fastcall Commit(void);
	virtual void __fastcall Rollback(void);
	__property void * Handle = {read=FHandle};
	__property void * LoginRec = {read=FLoginRec};
};


class DELPHICLASS TDirMsSqlQuery;
class PASCALIMPLEMENTATION TDirMsSqlQuery : public Zdirsql::TDirQuery 
{
	typedef Zdirsql::TDirQuery inherited;
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg();
	
public:
	__fastcall TDirMsSqlQuery(TDirMsSqlConnect* AConnect, TDirMsSqlTransact* ATransact);
	virtual int __fastcall Execute(void);
	virtual void __fastcall Open(void);
	virtual void __fastcall Close(void);
	virtual void __fastcall ShowDatabases( System::ShortString &DatabaseName);
	virtual void __fastcall ShowTables( System::ShortString &TableName);
	virtual void __fastcall ShowColumns( System::ShortString &TableName,  System::ShortString &ColumnName
		);
	virtual void __fastcall ShowIndexes( System::ShortString &TableName);
	virtual void __fastcall Next(void);
	virtual int __fastcall FieldCount(void);
	virtual int __fastcall RecordCount(void);
	virtual System::ShortString __fastcall FieldName(int FieldNum);
	virtual int __fastcall FieldSize(int FieldNum);
	virtual int __fastcall FieldMaxSize(int FieldNum);
	virtual int __fastcall FieldType(int FieldNum);
	virtual Db::TFieldType __fastcall FieldDataType(int FieldNum);
	virtual bool __fastcall FieldIsNull(int FieldNum);
	virtual AnsiString __fastcall Field(int FieldNum);
	virtual char * __fastcall FieldBuffer(int FieldNum);
	virtual AnsiString __fastcall StringToSql(AnsiString Value);
public:
	#pragma option push -w-inl
	/* TDirQuery.Destroy */ inline __fastcall virtual ~TDirMsSqlQuery(void) { }
	#pragma option pop
	
};


class DELPHICLASS TDirMsSqlStoredProc;
class PASCALIMPLEMENTATION TDirMsSqlStoredProc : public Zdirsql::TDirStoredProc 
{
	typedef Zdirsql::TDirStoredProc inherited;
	
private:
	void __fastcall BindParam(Db::TParam* Param);
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg();
	
public:
	__fastcall TDirMsSqlStoredProc(TDirMsSqlConnect* AConnect, TDirMsSqlTransact* ATransact);
	virtual void __fastcall Prepare(Db::TParams* Params);
	virtual void __fastcall UnPrepare(void);
	virtual void __fastcall ExecProc(void);
	virtual void __fastcall Open(void);
	virtual void __fastcall Close(void);
	virtual AnsiString __fastcall GetReturnValue();
	virtual void __fastcall ShowStoredProcs(void);
	virtual void __fastcall ShowParams( System::ShortString &StoredProcedureName);
	virtual void __fastcall Next(void);
	virtual int __fastcall FieldCount(void);
	virtual int __fastcall RecordCount(void);
	virtual int __fastcall ParamCount(void);
	virtual System::ShortString __fastcall FieldName(int FieldNum);
	virtual int __fastcall FieldSize(int FieldNum);
	virtual int __fastcall FieldMaxSize(int FieldNum);
	virtual int __fastcall FieldType(int FieldNum);
	virtual Db::TFieldType __fastcall FieldDataType(int FieldNum);
	virtual bool __fastcall FieldIsNull(int FieldNum);
	virtual AnsiString __fastcall Field(int FieldNum);
	virtual char * __fastcall FieldBuffer(int FieldNum);
	virtual System::ShortString __fastcall ParamName(int ParamNum);
	virtual int __fastcall ParamSize(int ParamNum);
	virtual int __fastcall ParamMaxSize(int ParamNum);
	virtual int __fastcall ParamType(int ParamNum);
	virtual Db::TFieldType __fastcall ParamDataType(int ParamNum);
	virtual bool __fastcall ParamIsNull(int ParamNum);
	virtual AnsiString __fastcall Param(int ParamNum);
	virtual char * __fastcall ParamBuffer(int ParamNum);
	virtual AnsiString __fastcall StringToSql(AnsiString Value);
public:
	#pragma option push -w-inl
	/* TDirStoredProc.Destroy */ inline __fastcall virtual ~TDirMsSqlStoredProc(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Word LIST_BLOCK_SIZE = 0x1f4;
static const Shortint MIN_FETCH_ROWS = 0x0;
static const Shortint MAX_NAME_LENGTH = 0x32;
static const Shortint MAX_LINKS_COUNT = 0x5;
static const Shortint MAX_SORT_COUNT = 0x5;
static const Byte MAX_FIELD_COUNT = 0xff;
static const Shortint MAX_INDEX_COUNT = 0x19;
static const Shortint MAX_INDEX_FIELDS = 0x19;
static const Shortint DEFAULT_STRING_SIZE = 0x32;
static const Word MAX_STRING_SIZE = 0x200;
static const char DEFAULT_MACRO_CHAR = '\x25';
#define ZEOS_PALETTE "Zeos Common"
#define ZEOS_DB_PALETTE "Zeos Access"
static const Word ZDBO_VERSION = 0xc47c;
static const Shortint SQL_PARAM_TYPE_UNKNOWN = 0x0;
static const Shortint SQL_PARAM_TYPE_INPUT = 0x1;
static const Shortint SQL_PARAM_TYPE_OUTPUT = 0x2;
static const Shortint SQL_RESULT_COL = 0x3;
static const Shortint SQL_PARAM_OUTPUT = 0x4;
static const Shortint SQL_RETURN_VALUE = 0x5;
extern PACKAGE Ztransact::TZZMonitorList* MonitorList;
extern PACKAGE int __fastcall DelphiToMsSqlType(const Db::TFieldType DelphiType);
extern PACKAGE Db::TParamType __fastcall MsSqlToDelphiParamType(int Value);
extern PACKAGE Db::TFieldType __fastcall MsSqlToDelphiType(int Value);
extern PACKAGE Db::TFieldType __fastcall MsSqlToDelphiTypeDesc(AnsiString Value);

}	/* namespace Zdirmssql */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Zdirmssql;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ZDirMsSql
